<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="icon" href="/static/images/favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="/static/images/favicon.ico" type="image/x-icon" />
<link rel='stylesheet' type='text/css' href='/static/easyui/themes/default/easyui.css' />
<link rel='stylesheet' type='text/css' href='/static/easyui/themes/icon.css' />
<link rel='stylesheet' type='text/css' href='/static/css/common.css' />
<link rel="stylesheet" type="text/css" href="/static/css/index.css" />
<script type='text/javascript' src='/static/easyui/jquery.min.js'></script>
<script type='text/javascript' src='/static/easyui/jquery.cookie.js'></script>
<script type='text/javascript' src='/static/easyui/jquery.easyui.min.js'></script>
<script type='text/javascript' src='/static/easyui/locale/easyui-lang-zh_CN.js'></script>
<script type='text/javascript' src='/static/js/jquery-form.js'></script>
<script type='text/javascript' src='/static/js/common.js'></script>
<script type='text/javascript' src='/static/js/My97DatePicker/WdatePicker.js'></script>
</head> 
 <body class="easyui-layout">
	<div class="header" data-options="region:'north',border:false">
		<div class="userinfo" style="margin-right:3%;width:auto;">
		&nbsp;&nbsp;
			<a onclick="logOut()" style="margin-left:0px" class="easyui-linkbutton" data-options="iconCls:'icon-ccOut',plain:true">
				退出登录
			</a>
		</div>
		<img src="/static/images/index_logo.png" style="margin-left: 30px;">
		<div id="smallCircle" class="smallCircle">
			<div id="divCount" style="font-size: 16px;">
				<span id="usr">昵称</span>
			</div> 
		</div>
		<div class="userinfo">
			欢迎您登录
		</div>
	</div>
	<div id="west" data-options="region:'west',split:true" style="width:220px;padding-top:3px">
		<div id="acco" class="easyui-accordion" >
	    	<div title="合同管理" data-options="iconCls:'icon-accolist',selected:true" >
	        	<a onClick="addTab('合同列表','/contractList.html');" class="easyui-linkbutton" data-options="iconCls:'icon-sanjiao',plain:true">合同列表 </a><br><br>
	        	<a onClick="addTab('创建合同','/contractCreate.html');" class="easyui-linkbutton" data-options="iconCls:'icon-sanjiao',plain:true">创建合同 </a> <br><br>
	        	<a onClick="addTab('合同盈亏汇总','/contractCollect.html');" class="easyui-linkbutton" data-options="iconCls:'icon-sanjiao',plain:true">合同盈亏汇总 </a> <br><br>
	    	</div>
	    	<div title="资源管理" data-options="iconCls:'icon-accolist',selected:true">
	        	<a onClick="addTab('材料列表','material.html');" class="easyui-linkbutton" data-options="iconCls:'icon-sanjiao',plain:true">材料列表   </a>    
	    		<a onClick="addTab('工具列表','tools.html');" class="easyui-linkbutton" data-options="iconCls:'icon-sanjiao',plain:true">工具列表   </a>    
	    	</div>
		    <div title="人员组织管理" data-options="iconCls:'icon-accolist',selected:true" >   
	    		<a onClick="addTab('账号管理','/userManage.html');" class="easyui-linkbutton" data-options="iconCls:'icon-sanjiao',plain:true">账号管理 </a>
	    		<a onClick="addTab('权限管理','/rightManage.html');" class="easyui-linkbutton" data-options="iconCls:'icon-sanjiao',plain:true">权限管理 </a>
	    	</div>
		</div>
	</div>
	<div id="content" class="easyui-tabs" data-options="region:'center',border:false,plain:true" >
	</div>
</body>
<script type="text/javascript">
$(function(){
	if(sessionStorage.getItem('userid')==""||sessionStorage.getItem('userid')==null){
 		var mssalet = $.messager.alert("提示","您尚未登陆，请登陆后重试");
		mssalet.window({modal:true,onBeforeClose:function() {
			window.location.href = "/login.html";
		}});
	}else{
		$("#usr").text(sessionStorage.getItem('nickname'));
		addTab('合同列表','/contractList.html');
	}
	$('#acco').accordion({
		border:false,
		fit:true,
		selected:false,
	});
});

/* 增加标签 */
function addTab(title, url){
	var content = '<iframe scrolling="auto" frameborder="0"  src="'+url+'" style="width:100%;height:100%;"></iframe>';
	if ($('#content').tabs('exists', title)){
		$('#content').tabs('close', title);	
	}
	$('#content').tabs('add',{
		title:title,
		content:content,
		closable:true,
		selected : true
	});
}
//退出登录
function logOut() { 
	$.ajax({
		async : false,
		url : getHost()+'/user/logout',
		type : 'get',
		dataType : 'json',
		contentType: 'application/json;charset=UTF-8',
		success : function(data) {
			if (data.code == "200") {
				sessionStorage.setItem('userid',"");
				sessionStorage.setItem('nickname',"");
				sessionStorage.setItem('username',"");
				window.location.href = "/login.html"
			}
		}
	});
}
</script>
</html>